﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace KaartSpel
{
    public partial class TroefVenster : Form
    {
        private FormController controller;

        public TroefVenster(FormController controller)
        {
            this.controller = controller;
            InitializeComponent();

            foreach (KaartenLib.Types t in Enum.GetValues(typeof(KaartenLib.Types)))
            {
                troefComboBox.Items.Add(t);
            }
            troefComboBox.SelectedIndex = 0;
            textBox1.Text = "0";
            textBox2.Text = "0";
            textBox1.Visible = false;
            textBox2.Visible = false;
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked)
            {
                textBox1.Visible = true;
            }
            else
            {
                textBox1.Visible = false;
                textBox1.Text = "0";
            }
        }

        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox2.Checked)
            {
                textBox2.Visible = true;
            }
            else
            {
                textBox2.Visible = false;
                textBox2.Text = "0";
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int punten = Convert.ToInt32(textBox1.Text);
            int aantal = Convert.ToInt32(textBox2.Text);

            if (controller.evalueerInzet(punten, aantal))
            {
                controller.startSpel(punten, aantal, troefComboBox.Text);
            }
        }

        private void TroefVenster_Load(object sender, EventArgs e)
        {

        }

        
    }
}
